<form id="<?php echo $uniqid;?>" style="padding:5px">
    <table border="0" width="100%" cellspacing="1" cellpadding="5" class="formtable">

        <tr bgcolor="#FFFFFF">
            <td style="line-height:30px;" width="20%">快递公司名称：</td>
            <td width="80%"><input type="text"
                                   class="forminput inputstyle validatebox-text textbox-prompt easyui-validatebox"
                                   placeholder="请输入名称.."  v-model="params.name"/></td>
        </tr>
        <tr bgcolor="#FFFFFF">
            <td style="line-height:30px;" width="20%">快递公司编码：</td>
            <td width="80%"><input type="text"
                                   class="forminput inputstyle validatebox-text textbox-prompt easyui-validatebox"
                                   placeholder="请输入快递公司编码.."  v-model="params.code"/></td>
        </tr>
        <tr bgcolor="#FFFFFF">
            <td style="line-height:30px;" width="20%">权重：</td>
            <td width="80%"><input type="text"
                                   class="forminput inputstyle validatebox-text textbox-prompt easyui-validatebox"
                                   placeholder="请输入权重.."  v-model="params.weigh"/></td>
        </tr>
    </table>
</form>

<script>
    $(function () {
        $('#expresssubmit').click(function (data) {
            expressVm.submit();
        })
    });
    var expressVm = new Vue({
        el: '#<?php echo $uniqid;?>',
        data: {
            params: JSON.parse("<?php echo addslashes($dataset);?>"),
        },
        methods: {
            submit() {
                let act = expressVm.params.id > 0 ? 'edit' : 'add';
                $.post('/admin/express/'+ act, expressVm.params, function (data) {
                    if (data.ret === 0) {
                        $.messager.show({
                            title: '提示',
                            msg: data.msg,
                            timeout: 3000,
                            showType: 'slide'
                        });
                        $('#<?php echo $uniqid;?>').form('clear');
                        $("#expressDlg").dialog('close');
                        expressReload();
                    } else {
                        $.messager.alert('提示', data.msg, 'warning');
                    }
                });
            }
        }
    });
</script>